	TITLE	'INITIALIZE FCB'
	PUBLIC	INITFCB
	NAME	'INITFCB'
;
;INITFCB - INITIALIZES THE FCB TO ZERO BUT DOES NOT DISTURB THE DISK
;	DESIGNATOR OR FILENAME AND EXTENSION.
;ON ENTRY	DX-->FCB  (MUST BE IN DATA SEGMENT)
;ON EXIT	NO REGISTERS ARE DISTURBED FCB IS CLEARED AS ABOVE.
;

	CSEG

FCBLEN	EQU	36	;SIZE OF FCB
FNLENGTH EQU	12	;COMPLETE FILENAME DESIGNATOR SIZE

INITFCB: PUSH	AX
	PUSHF		;PRESERVE DIRECTION FLAG
	PUSH	CX
	PUSH	DI
	PUSH	ES
	MOV	AX,DS	;MAKE EXTRA SEGMENT POINT TO DATA SEGMENT
	MOV	ES,AX
	MOV	CX,FCBLEN-FNLENGTH/2
	XOR	AX,AX	;MAKE A=0
	MOV	DI,DX	;DX-->FCB ADDRESS
	ADD	DI,FNLENGTH	;PASS FILE NAME
	CLD
	REP STOSW
	POP	ES	;RESORE EVERYTHING
	POP	DI
	POP	CX
	POPF
	POP	AX
	RET		;RETURN IN THIS SEGMENT
	END
